function unit(xpos,ypos,img,hp,id,playerId,type,dmg,range,spells,atkspeed,speed)
{
	this.x=xpos;
	this.y=ypos;
	this.img = img;
	this.hp=hp;
	this.maxhp=hp;
	this.id=id;
	this.playerId=playerId;
	this.type=type;
	this.dmg=dmg;
	this.range=range;
	this.spells=spells;
	this.atkspeed=atkspeed;
	this.speed=speed;
	
	this.xNext=xpos;
	this.yNext=ypos;
}
